<table style='width: 100%;'>
	<tr>
		<td style='vertical-align: top; width: 300px;'>
			<div class='menusSortable'>
				<? 
				foreach($menus as $menu){ ?>
				<div class='menusSortableItem' id='menu-<? echo $menu->id; ?>'>
					<table cellspacing='0' cellpadding='1'>
						<tr>
							<td>
								<span class='ui-icon ui-icon-arrowthick-2-n-s' style='float: left;'></span>&nbsp;<span class='nom'><? echo $menu->get_titre(); ?></span>
							</td>
							<td style='width: 10px; border-width: 0px; border-left: 1px solid #000000;' onmouseover='$(this).addClass("ui-state-hover");' onmouseout='$(this).removeClass("ui-state-hover");' onclick='menusModifier(<? echo $menu->id; ?>);'>
								<span class="ui-icon ui-icon-pencil tooltip" title='Modifier ce menu'></span>
							</td>
							<td style='width: 10px; border-width: 0px; border-left: 1px solid #000000;' onmouseover='$(this).addClass("ui-state-hover");' onmouseout='$(this).removeClass("ui-state-hover");' onclick='menusSupprimer(this);'>
								<span class="ui-icon ui-icon-circle-close tooltip" title='Supprimer ce menu'></span>
							</td>
						</tr>
					</table>
				</div>
				<? } ?>
			</div>
			<br />
			<div class='align-center'><a href="#" onclick="window.open('admin?confmodule=menus','_self');" class="a-button ui-state-default ui-corner-all"><span class="ui-icon ui-icon-circle-plus"></span>Nouveau menu</a></div>
			<br />
		</td>
		<td style='vertical-align: top;'>
			<? if(isset($_REQUEST["editMenu"])){
				$var=$sql->request_single("select * from ".CFG_MYSQL_PREFIX."menu where id=".$_REQUEST["editMenu"]);
				$menu=new menu($var); ?>
			<div class='ui-widget-header ui-corner-all title2'>Modifier un menu</div>
			<div id='contenu_content' class='ui-corner-all ui-widget-content'>
				<form name='formAdminEditMenu' method='post' action=''>
					<table style='width: 100%;'>
						<tr class='tr1'>
							<td>Titre : </td>
							<td><input type='text' name='titre' value='<? echo $menu->get_titre(); ?>' /></td>
						</tr>
						<tr class='tr2'>
							<td>Module : </td>
							<td>
								<select name='module' onchange='menusCheckModule(this.options[this.selectedIndex].value);'>
									<option value=''>-- Choisissez un module ou tapez directement une URL --</option>
									<? foreach($modules as $key=>$value){
										if($key==$menu->module) echo "<option value='".$key."' selected='selected'>".$value."</option>\n";
										else echo "<option value='".$key."'>".$value."</option>\n";
									} ?>
								</select>
							</td>
						</tr>
						<tr class='tr1'>
							<td>URL : </td>
							<td><input type='text' id='lien' name='lien' style='width: 250px;' value='<? echo $menu->lien; ?>' <? if($menu->module!="") echo "disabled='disabled'"; ?> /></td>
						</tr>
					</table>
					<br />
					<div class='align-center'><a href="#" onclick="open_loading();  document.formAdminEditMenu.submit();" class="a-button ui-state-default ui-corner-all"><span class="ui-icon ui-icon-newwin"></span>Modifier</a></div>
					<br />
					<input type="hidden" name='id' value='<? echo $menu->id; ?>' />
					<input type="hidden" name='action' value='editer_menu' />
				</form>
			</div>
			<? }else{ ?>
			<div class='ui-widget-header ui-corner-all title2'>Ajouter un menu</div>
			<div id='menu_content' class='ui-corner-all ui-widget-content'>
				<form name='formAdminAddMenu' method='post' action=''>
					<table style='width: 100%;'>
						<tr class='tr1'>
							<td>Titre : </td>
							<td><input type='text' name='titre' /></td>
						</tr>
						<tr class='tr2'>
							<td>Module : </td>
							<td>
								<select name='module' onchange='menusCheckModule(this.options[this.selectedIndex].value);'>
									<option value=''>-- Choisissez un module ou tapez directement une URL --</option>
									<? foreach($modules as $key=>$value){
									echo "<option value='".$key."'>".$value."</option>\n";
									} ?>
								</select>
							</td>
						</tr>
						<tr class='tr1'>
							<td>URL : </td>
							<td><input type='text' id='lien' name='lien' style='width: 250px;' /></td>
						</tr>
					</table>
					<br />
					<div class='align-center'><a href="#" onclick="open_loading();  document.formAdminAddMenu.submit();" class="a-button ui-state-default ui-corner-all"><span class="ui-icon ui-icon-circle-plus"></span>Ajouter</a></div>
					<br />
					<input type="hidden" name='action' value='ajouter_menu' />
				</form>
			</div>
			<? } ?>
		</td>
	</tr>
</table>
